<?php
namespace Model;

use Think\Model;

class skillShareModel extends Model {
    //设置验证规则
    //是否批处理验证
    protected $patchValidate = true;
    //自动验证定义
    protected $_validate = array(
	//①验证手机号码是否为纯数字
//	array('user_account','number','手机号格式错误'),
	
	//②验证手机号码是否为11位
	array('user_account','11','请输入正确的手机号码', 0,'length'),

    );
    
    //读取数据
    public function read_data($skill_id) {
//	echo $skill_id;
//	$skill = D('skill_share');

       $sql = "SELECT
	   
	    skill_id,  skill_img_name_small0,  skill_img_name_small1,  skill_img_name_small2,  skill_img_name_small3,  skill_img_name_small4,  
	    skill_title,  skill_price,  user_school,  skill_position,  skill_share_count,  skill_unit,  skill_limit_sex,  skill_limit_credit,  skill_score,
	    skill_comment_number,  skill_describe,  skill_time_quantum,
	    
	    user_nickname,user_head_small_img,user_student_identification,user_realname_identification,user_sex,user_grade,user_share_number,user_share_time,
	    user_comment_number,user_score,skill_contact_way,skill_contact_way_value

	    FROM
	    wx_skill_share,wx_user

	    WHERE "."skill_id = $skill_id and ".
	    "wx_skill_share.skill_user = wx_user.user_account
	    ;";
//	dump($sql);exit;

        $info = $this->query($sql);
//	exit;
	
//	$info = D('skill_share') -> find($skill_id);
//	$this ->assign('info', $info[0]);
	return $info;
    }

}